<template>
  <div>
    <h1>{{ activity.title }}</h1>
    <p>{{ activity.description }}</p>
    <p>日期：{{ activity.date }}</p>
    <p>地点：{{ activity.location }}</p>
  </div>
</template>

<script>
import activities from '@/views/activities.js';

export default {
  data() {
    return {
      activity: {},
    };
  },
  created() {
    const activityId = parseInt(this.$route.params.id, 10);
    this.activity = activities.find((a) => a.id === activityId);
  },
};
</script>